import 'dart:async';

import 'package:hc_bio_sdk/model/rr.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'hc_bio_sdk_method_channel.dart';

abstract class HcBioSdkPlatform extends PlatformInterface {
  /// Constructs a HcBioSdkPlatform.
  HcBioSdkPlatform() : super(token: _token);

  static final Object _token = Object();

  static HcBioSdkPlatform _instance = MethodChannelHcBioSdk();

  final StreamController dataStream = StreamController.broadcast();

  /// The default instance of [HcBioSdkPlatform] to use.
  ///
  /// Defaults to [MethodChannelHcBioSdk].
  static HcBioSdkPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [HcBioSdkPlatform] when
  /// they register themselves.
  static set instance(HcBioSdkPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future append(RRModel rr) {
    throw UnimplementedError('append() has not been implemented.');
  }

  Future initialize(String channelCode) {
    throw UnimplementedError('initialize() has not been implemented.');
  }

  Future login({required String userID}) {
    throw UnimplementedError('login() has not been implemented.');
  }
}
